const Koa = require('koa');
const koaBody = require('koa-body');
const cors = require('./cors'); //解决跨域
const session = require('./session'); //存储cookie
const gzip = require('./gzip'); //压缩中间件
const router = require('./router'); //路由中间建
const koaStatic = require('./koaStatic'); //静态文件中间件
const connect = require('./database');
// const interceptor = require('./Interceptor');//拦截器
const app = new Koa();
// app.use(interceptor); //拦截
cors(app); //
session(app);//
koaStatic(app);
app.use(koaBody());
router(app);//
gzip(app);
// app.listen(8080, () => console.log('端口在8080上运行'));
connect(app);
